<?php
// +----------------------------------------------------------------------
// | ITKEE [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017 http://www.itkee.cn.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: SuperMan <superman@itkee.cn>
// +----------------------------------------------------------------------

namespace app\admin\controller;

use app\common\controller\AdminBase;
use app\common\model\Article;
use app\common\model\Comments;
use app\common\model\User;
use think\Db;

class Index extends AdminBase
{
    protected function _initialize()
    {
        parent::_initialize(); // TODO: Change the autogenerated stub
    }

    public function index()
    {
        return $this->fetch('index');
    }

    public function webSite()
    {
        $version = Db::query('SELECT VERSION() AS ver');
        $config = [
            'url'               => $_SERVER['HTTP_HOST'],
            'document_root'     => $_SERVER['DOCUMENT_ROOT'],
            'server_os'         => PHP_OS,
            'server_port'       => $_SERVER['SERVER_PORT'],
            'server_soft'       => $_SERVER['SERVER_SOFTWARE'],
            'php_version'       => PHP_VERSION,
            'mysql_version'     => $version[0]['ver'],
            'max_upload_size'   => ini_get('upload_max_filesize')
        ];
        return $this->fetch('config', ['config' => $config]);
    }
}
